from apscheduler.schedulers.blocking import BlockingScheduler


class CornUtils:
    """
        定时任务工具类
    :return:
    """


    """
        给定cron表达式循环执行任务
    """

    @staticmethod
    def corn_run(corn_expression, func):
        scheduler = BlockingScheduler()
        scheduler.add_job(func, 'cron', hour=corn_expression)
        scheduler.start()